


<script>
  import config from './config'
  import store from '@/store'
  import { getToken } from '@/utils/auth'

  export default {
    onLaunch: function() {
      this.initApp()
    },
    methods: {
      // 初始化应用
      initApp() {
        // 初始化应用配置
        this.initConfig()
        // 检查用户登录状态
        //#ifdef H5
        this.checkLogin()
        //#endif
      },
      initConfig() {
        this.globalData.config = config
      },
      checkLogin() {
        if (!getToken()) {
          this.$tab.reLaunch('/pages/login') 
        }
      },
	  gotoPublish() {
	        uni.navigateTo({
	          url: '/pages/publish/publish'
	        });
	      }
    }
  }
</script>

<style lang="scss">
  @import '@/static/scss/index.scss';
  @import "uview-ui/index.scss";
  
  /* 自定义发布按钮样式 */
  .custom-tabbar-publish {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background-color: #FF0000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  }
  
  .custom-tabbar-publish image {
    width: 30px;
    height: 30px;
  }
</style>
